/**
 * 
 */
function Interface()
{
	/**
	 * Keeps track of the current color
	 */
	//this.current_color = new Color(203, 53, 148, 1);
	
	this.current_color = new Color(0, 0, 0, 1);
	
	
	this.currentBackgroundColor = new Color(255, 255, 255, 1);
	/**
	 * Keeps track of the current thickness (2 by default)
	 */
	this.current_thickness = 2;
	
	/**
	 * Keeps track of the current shape used (free, line, circle ...)
	 */
	this.current_shape = "Free";
	
	/**
	 * Keeps track of the current tool used (pen, eraser ...)
	 */
	this.current_tool = new Pen(this.current_color, this.current_thickness);
	
	
	this.setBackgroundColor = function(color){
		this.currentBackgroundColor = color;
	}
	
	this.getBackgroundColor = function(){
		return this.currentBackgroundColor;
	}
	
	/**
	*
	*/
	this.setThickness = function (thickness)
	{
		this.current_thickness = parseInt(thickness);
		
		this.getTool().setThickness(this.current_thickness);
		
	};
	
	this.getShape = function(){
		return this.current_shape;
	}
	
	this.getThickness = function(){
		return this.current_thickness;
	}
	
	this.getColor = function(){
		return this.current_color;
	}
	
	this.getTool = function(){
		return this.current_tool;
	}
	
	this.setTool = function(tool){
		switch (tool){
			case "Pen":
				this.current_tool = new Pen(this.current_color, this.current_thickness);
				break;
			case "Eraser":
				this.current_tool = new Eraser(this.getBackgroundColor(), this.current_thickness);
				this.setShape("Free");
				break;
			default:
				this.current_tool = new Pen(this.current_color, this.current_thickness);
				this.setShape("Free");
				break;
		}
	}
	
	
	/**
	*
	*/
	this.setShape = function (type)
	{
		this.current_shape = type;
	};
	
	/**
	*
	*/
	this.setColor = function (color)
	{
		var r = parseInt("0x"+color[0] + color[1]);
		var g = parseInt("0x"+color[2] + color[3]);
		var b = parseInt("0x"+color[4] + color[5]);
		
		
		this.current_color = new Color(r, g, b, 1);
		
		this.getTool().setColor(this.current_color);
	};
	
	
}